package com.bwie.controller;
import com.bwie.service.MenuService;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.dto.UserPwdVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* 用户信息(t_user)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/auth")
@Api(tags = "用户登录公共接口")
public class UserController {
/**
* 服务对象
*/
    @Autowired
    private UserService userService;

    @Autowired
    private MenuService menuService;

    @ApiOperation("密码登录")
    @PostMapping("pwdLogin")
    public R pwdLogin(@RequestBody @Validated UserPwdVo userVo){
    return userService.pwdLogin(userVo);
    }


    @ApiOperation("权限管理信息")
    @GetMapping("selectMenuListById")
    public R selectMenuListById(){
        return menuService.selectMenuListById();
    }

    @GetMapping("selectUserInfoById/{userId}")
    public R selectUserInfoById(@PathVariable("userId") Integer userId){
        return userService.selectUserInfoById(userId);
    }





}
